package barbershop.com.service.impl;

import barbershop.com.dao.AdminDao;
import barbershop.com.entity.Admin;
import barbershop.com.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AdminServiceImpl implements AdminService {
    @Autowired
    private AdminDao adminDao;

    @Override
    public Admin login(String aName, String aPwd) {
        try {
            Admin admin = this.adminDao.aLogin(aName, aPwd);
            System.out.println("系统管理员"+admin.getaName()+"验证成功！");
            return admin;
        }   catch (Exception e){
            e.printStackTrace();
            System.out.println("验证失败！");
        }
        return null;
    }
}
